#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main()
{
    int N = 0;
    int M = 0;
    int arr[100][100] = { 0 };
    scanf("%d %d", &N, &M);
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < M; j++)
        {
            scanf("%d", &arr[i][j]);
        }
    }
    int count = 0;
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < M; j++)
        {
            if (arr[i][j] > 0)
                count += arr[i][j];
        }
    }
    printf("%d", count);
    return 0;
}